Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make allow negative keep alive value with OllamaEmbeddingModel #2256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dev-jonghoonpark
Copy link
Contributor

Motivation:

In issue #2197, it was identified that the keep-alive option for embedding models did not allow negative values. This limitation restricted certain configurations as described in the documentation.

Modification:

Updated the regex to enable the keep-alive option for embedding models to accept negative values.

Result:

Users can now configure negative values for the keep-alive option in embedding models, addressing the issue mentioned.
This resolves #2197.

Verification:

When set to 1m:

The keep-alive duration is correctly set to 1 minute.

Logs:

[GIN] 2025/02/17 - 07:45:12 | 200 |   53.186102ms |   192.168.88.61 | POST     "/api/embed"
time=2025-02-17T07:45:12.956Z level=DEBUG source=sched.go:407 msg="context for request finished"
time=2025-02-17T07:45:12.956Z level=DEBUG source=sched.go:339 msg="runner with non-zero duration has gone idle, adding timer" modelPath=/root/.ollama/models/blobs/sha256-819c2adf5ce6df2b6bd2ae4ca90d2a69f060afeb438d0c171db57daa02e39c3d duration=1m0s

When set to -1m:

The keep-alive duration is correctly interpreted as infinite, as documented.

Logs:

[GIN] 2025/02/17 - 07:40:34 | 200 |   1.04253822s |        10.8.0.3 | POST     "/api/embed"
time=2025-02-17T07:40:34.201Z level=DEBUG source=sched.go:466 msg="context for request finished"
time=2025-02-17T07:40:34.201Z level=DEBUG source=sched.go:339 msg="runner with non-zero duration has gone idle, adding timer" modelPath=/root/.ollama/models/blobs/sha256-819c2adf5ce6df2b6bd2ae4ca90d2a69f060afeb438d0c171db57daa02e39c3d duration=2562047h47m16.854775807s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OllamaEmbeddingModel - Duration validation not aligned with the Ollama Docs
1 participant